local zhulan = fk.CreateSkill{
    name = "jin_heg__zhulan",
}

Fk:loadTranslationTable{
    ["jin_heg__zhulan"] = "助澜",
    [":jin_heg__zhulan"] = "其他角色受到伤害时，若伤害来源与其势力相同，你可弃置一张牌令此伤害+1。",
    ["#jin_heg__zhulan_prompt"] = "助澜：你可弃置一张牌，令此伤害+1",

    ["$jin_heg__zhulan1"] = "谁敢反朕，朕就诛他九族！",
    ["$jin_heg__zhulan2"] = "我死后，管他洪水滔天。",
}


local H = require "packages.ol_hegemony.util"

zhulan:addEffect(fk.DamageInflicted,{
    anim_type = "offensive",
    can_trigger = function (self, event, target, player, data)
        return player:hasSkill(zhulan.name) and target ~= player and data.from and H.compareKingdomWith(data.from, target) and not player:isNude()
      end,
    on_cost = function (self, event, target, player, data)
        local discard = player.room:askToDiscard(player,{
            max_num = 1,
            min_num = 1,
            prompt = "#jin_heg__zhulan_prompt",
            skill_name = zhulan.name,
            include_equip = true,
            cancelable = true,
            skip = true,
        })
        if discard and #discard > 0 then
          event:setCostData(self, {discard = discard})
          return true
        end
      end,
    on_use = function (self, event, target, player, data)
        local room = player.room
        room:throwCard(event:getCostData(self).discard, zhulan.name, player, player)
        data:changeDamage(1)
    end,
})

return zhulan